package cn.faifai.desktop.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class VirtualThreadPoolManager {
    private VirtualThreadPoolManager(){};
    private static class SingletonHolder{
        private static final ExecutorService INSTANCE = Executors.newVirtualThreadPerTaskExecutor();
    }
    public static ExecutorService getInstance(){
        return SingletonHolder.INSTANCE;
    }

    public static void shutdownAll(){
        getInstance().shutdownNow();
    }
}
